﻿@model Wolfy.NetDisk.Site.Models.UserViewModel

@{
    ViewBag.Title = "Wolfy 云盘 注册";
    Layout = null;
}
<html>
<head>
    <title></title>
    <meta name="viewport" content="width=device-width,height=device-height, user-scalable=no,initial-scale=1, minimum-scale=1, maximum-scale=1" />
    <script src=@Url.ScriptOrCss("~/Content/Scripts/jquery-1.10.2.min.js")></script>
    <link href=@Url.ScriptOrCss("~/Content/Css/bootstrap.min.css") rel="stylesheet" />
    <link href=@Url.ScriptOrCss("~/Content/Css/font-awesome.css") rel="stylesheet" />
    <link href=@Url.ScriptOrCss("~/Content/Css/animate.css") rel="stylesheet" />
    <link href=@Url.ScriptOrCss("~/Content/Css/Login.css") rel="stylesheet" />
</head>
<body>
    <div class="middle-box text-center loginscreen animated fadeInDown ">
        <div>
            <div class="logo">
                <img src=@Url.ScriptOrCss("~/Content/Images/logo.png") />
            </div>
            <h3 class="m-t">用户注册</h3>
            <br />
            @using (Ajax.BeginForm(new AjaxOptions { HttpMethod = "post", Url = "Account/Register" }))
            {
                <div class="form-group">
                    @Html.TextBoxFor(o => o.UserName, new { @class = "form-control", placeholder = "用户名" })
                </div>
                <div class="form-group">
                    @Html.PasswordFor(o => o.Pwd, new { @class = "form-control", placeholder = "密码" })
                </div>
                <div class="form-group">
                    @Html.PasswordFor(o => o.SurePwd, new { @class = "form-control", placeholder = "确认密码" })
                </div>
                <div class="form-group">
                    @Html.DropDownListFor(o => o.Gender, ViewData["genders"] as IEnumerable<SelectListItem>, new { @class = "form-control" })
                </div>
                <div class="form-group">
                    @Html.DropDownListFor(o => o.Department, ViewData["departments"] as IEnumerable<SelectListItem>, new { @class = "form-control" })
                </div>
                <div class="form-group">
                    @Html.TextBoxFor(o => o.VerifyCode, new { @class = "form-control", placeholder = "验证码" })
                </div>
                <div class="form-group">
                    <img src=@Url.Content("~/Account/GetVerifyCode") alt="验证码" title="看不清？换一张" id="imgVerifyCode" />
                </div>
                <div class="form-group">
                    <span style="color:red;">
                        @Html.ValidationMessageFor(o => o.UserName)
                        @Html.ValidationMessageFor(o => o.Pwd)
                        @Html.ValidationMessageFor(o => o.SurePwd)
                        @Html.ValidationMessageFor(o => o.VerifyCode)
                        @Html.ValidationSummary(true)
                    </span>
                </div>
                <div class="form-group">
                    <input type="submit" class="form-control" name="name" value="注   册" />
                </div>
            }

            <script>
                $('#imgVerifyCode').on('click', function () {
                    this.src = "/Account/GetVerifyCode?_r=" + Math.random();
                });
            </script>
        </div>
    </div>
</body>
</html>
